package top.wugy.blog.model;

import com.jfinal.plugin.activerecord.*;
import top.wugy.blog.kits.Const;

import java.util.Date;

/**
 * wugy on 2017/11/13 13:11
 */
public class TTimeLine extends Model<TTimeLine> implements IBean {

    public static final TTimeLine dao = new TTimeLine();

    public TTimeLine setId(Integer id) {
        return set("id", id);
    }

    public Integer getId() {
        return get("id");
    }

    public TTimeLine setContent(String content) {
        return set("content", content);
    }

    public String getContent() {
        return get("content");
    }

    public TTimeLine setCreateTime(Date createTime) {
        return set("createTime", createTime);
    }

    public Date getCreateTime() {
        return get("createTime");
    }

    public Page<Record> timeline(int pageNum) {
        return Db.paginate(pageNum, Const.DEF_PAGE_SIZE, "SELECT *", "FROM " +
                Const.TABLE_TIMELINE + " ORDER BY createTime DESC");
    }

}
